<template>
  <div>
    <ul>
      <li
        v-for="obj in arr"
        :key="obj.id"
      >
        {{ obj.name }}
      </li>
    </ul>
    <button @click="addBtn">新增一个</button>
  </div>
</template>

<script>
export default {
  data () {
    return {
      arr: [
        {
          name: "老大",
          id: 1,
        },
        {
          name: "老二",
          id: 2,
        },
        {
          name: "老三",
          id: 3,
        },
      ],
    };
  },
  methods: {
    addBtn () {
      this.arr.splice(1, 0, {
        name: "新来的",
        id: 4,
      });
    },
  },
};
</script>

<style>
</style>